package com.gopay.common.log.ot;

import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.gopay.common.cipher.utils.LoggerMaskUtils;

/**
 * 日志基础VO
 * 
 * @LogOTBaseVO.java
 * @author dak.wang
 * @2016年4月19日 上午9:25:04 www.gopay.com.cn Inc.All rights reserved.
 */
public abstract class LogOTBaseVO {

    private String operTypeCd=getOperTypeCd();
    private String launchCustId; // 发起人
    private String launchCustName;
    private String launchUserId;
    private String launchUserName;
    private String targetCustId; // 目标人
    private String targetCustName;
    private String targetUserId;
    private String targetUserName;
    private String stepCode;// 步骤号
    private String stepName;// 步骤名称

    public String getOrderId() {
        return orderId;
    }

    public void setOrderId(String orderId) {
        this.orderId = orderId;
    }

    private String orderId; //订单ID  add by zjt
    public LogOTBaseVO() {
    }
    
    public abstract String getOperTypeCd();

   
    public void setOperTypeCd(String operTypeCd) {
        this.operTypeCd = operTypeCd;
    }

    public String getLaunchCustId() {
        return launchCustId;
    }

    public void setLaunchCustId(String launchCustId) {
        this.launchCustId = launchCustId;
    }

    public String getLaunchCustName() {
        return launchCustName;
    }

    public void setLaunchCustName(String launchCustName) {
        this.launchCustName = launchCustName;
    }

    public String getLaunchUserId() {
        return launchUserId;
    }

    public void setLaunchUserId(String launchUserId) {
        this.launchUserId = launchUserId;
    }

    public String getLaunchUserName() {
        return launchUserName;
    }

    public void setLaunchUserName(String launchUserName) {
        this.launchUserName = launchUserName;
    }

    public String getTargetCustId() {
        return targetCustId;
    }

    public void setTargetCustId(String targetCustId) {
        this.targetCustId = targetCustId;
    }

    public String getTargetCustName() {
        return targetCustName;
    }

    public void setTargetCustName(String targetCustName) {
        this.targetCustName = targetCustName;
    }

    public String getTargetUserId() {
        return targetUserId;
    }

    public void setTargetUserId(String targetUserId) {
        this.targetUserId = targetUserId;
    }

    public String getTargetUserName() {
        return targetUserName;
    }

    public void setTargetUserName(String targetUserName) {
        this.targetUserName = targetUserName;
    }

    public String getStepCode() {
        return stepCode;
    }

    public void setStepCode(String stepCode) {
        this.stepCode = stepCode;
    }

    public String getStepName() {
        return stepName;
    }

    public void setStepName(String stepName) {
        this.stepName = stepName;
    }

    public String toMaskJsonString() {
        String jsonStr = JSONObject.toJSONString(this, SerializerFeature.WriteMapNullValue);
        JSONObject jsonObj = JSONObject.parseObject(jsonStr);
        if(jsonObj.containsKey("launchCustId") && LoggerMaskUtils.isLikeMobile(launchCustId)){
            jsonObj.put("launchCustId", LoggerMaskUtils.maskString(launchCustId));
        }
        if(jsonObj.containsKey("launchCustName") && LoggerMaskUtils.isLikeMobile(launchCustName)){
            jsonObj.put("launchCustName", LoggerMaskUtils.maskString(launchCustName));
        }
        String resStr = JSONObject.toJSONString(jsonObj, SerializerFeature.WriteMapNullValue);
        return resStr;
        }
}
